import { defineApplicationConfig } from '@vben/vite-config';

export default defineApplicationConfig({
  overrides: {
    optimizeDeps: {
      include: [
        'echarts/core',
        'echarts/charts',
        'echarts/components',
        'echarts/renderers',
        '@iconify/iconify',
        'ant-design-vue/es/locale/zh_CN',
        'ant-design-vue/es/locale/en_US',
      ],
    },
    server: {
      proxy: {
        '/serviceRecord': {
          target: 'http://47.99.122.137:20041',
          changeOrigin: true,
          ws: true,
          // rewrite: (path) => path.replace(/^\/serviceRecord/, ''),
          // only https
          // secure: false
        },
        '/customerManagement': {
          target: 'http://47.99.122.137:20041',
          changeOrigin: true,
          ws: true,
          // rewrite: (path) => path.replace(/^\/customerManagement/, ''),
          // only https
          // secure: false
        },
        '/serviceReminder': {
          target: 'http://47.99.122.137:20041',
          changeOrigin: true,
          ws: true,
          // rewrite: (path) => path.replace(/^\/serviceReminder/, ''),
          // only https
          // secure: false
        },
        '/user': {
          target: 'http://47.99.122.137:20041',
          changeOrigin: true,
          ws: true,
          // rewrite: (path) => path.replace(/^\/user/, ''),
          // only https
          // secure: false
        },
        '/devices': {
          target: 'http://47.99.122.137:20041',
          changeOrigin: true,
          ws: true,
        },
        '/sources': {
          target: 'http://47.99.122.137:20041',
          changeOrigin: true,
          ws: true,
        },
        '/returnReason': {
          target: 'http://47.99.122.137:20041',
          changeOrigin: true,
          ws: true,
        },
      },
    },
  },
});
